import React from 'react';
import {Button} from 'antd';
import {hasPermission} from "@/common/permission";

export default function AuthButton(props: any) {
  let disabled = props.disabled;
  if (props.auth && !hasPermission(props.auth)) {
    disabled = true;
  }
  return disabled ? null : <Button {...props}>{props.children}</Button>
}
